-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: create StackTokenPair #38
Conversation
While testing got Application error. details
How to reproduce:
Note: Selecting other tokens seems fine. Looking at the console it looks like:
|
@@ -70,6 +86,14 @@ export const Stackbox = () => { | |||
setEndDateTime(new Date(endDateByFrequency[frequency])); | |||
}, [frequency]); | |||
|
|||
const formattedBalance = (balanceData: NonNullable<typeof balance>) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function could be extracted to utils/token
file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should uniformize all this formates in the app. And add this formatting to a specific file. If you agree will create a task to do this. But we can keep this function inside Stackbox for this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree on standardizing formats throughout the app but I agree with Diogo to abstract this function into a utils
file, because, in my experience, these functions tend to grow and change their signature as the app needs to grow. At some point, I'm sure we will abstract this function, sooner or later.
I don't mind handling that abstraction in a different PR as long as we handle it, either here or in another task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created this issue to tackle this in our app https://linear.app/swaprdev/issue/STK-104/format-token-amounts
Deploying with Cloudflare Pages
|
647e1a6
to
e366931
Compare
still not fixed |
e366931
to
1658799
Compare
const formattedBalance = (balanceData: NonNullable<typeof balance>) => { | ||
const SIGNIFICANT_DIGITS = 5; | ||
|
||
/* parseFloat as some number size limitations so this is a temporary solution */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* parseFloat as some number size limitations so this is a temporary solution */ | |
/* parseFloat has some number size limitations so this is a temporary solution */ |
what are the limitations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description is clearer now.
1658799
to
f5406ef
Compare
Creates StackTokenPair section. Formatted balance isn't consistent throughout the code base.